<!--{eval $_TPL['titles'] = array('我的T邮');}-->
<!--{template header_tpl}-->
<div class="grid_16 main_box">
	<div class="grid_16 box">
		<h1>我的T邮</h1>
		<!--{if $pms[list]}-->
			<div class="grid_16 alpha omega">
				<ul class="pm_list" id="pm_ul">
					<!--{loop $pms[list] $key $value}-->
					<li class="s_clear">
						<!--{if $value[msgfromid] != $userinfo[uid]}-->
						<div class="left">
						<!--{else}-->
						<div class="right">
						<!--{/if}-->
							<div class="avatar">
								<!--{if $value[msgfromid]}-->
									<a href="{SITEURL}home/index/$value[msgfromid]"><img src ="{$value[avatar_small]}" ></a>
								<!--{else}-->
									<img src="{SITEURL}resources/images/systempm.gif" width="50" height="50" />
								<!--{/if}-->
							</div>
							<div class="pm_body">
								<!--消息头部-->
								<div class="pm_top_a"><div class="pm_top_b"><div class="pm_top_c">&nbsp;</div></div></div>
							
								<div class="pm_h"><div class="pm_f">
									<p><!--{if $value[msgfromid]}-->
											<a href="{SITEURL}home/index/$value[msgfromid]">{$_SN[$value[msgfromid]]}</a> 
										<!--{/if}-->
										<span class="gray"><!--{date('Y-m-d H:i',$value['dateline'],1)}--></span>
									</p>
									<div class="pm_c">
										$value[message]
									</div>
								</div></div>
								<!--消息尾部-->
								<div class="pm_bot_a"><div class="pm_bot_b"><div class="pm_bot_c">&nbsp;</div></div></div>
							</div>
						</div>
					</li>
					<!--{/loop}-->
				</ul>
			</div>
			<!--{if isset($pms[multi])}-->
			<div class="grid_16 footactions">
				<div class="pages">
					$pms[multi]
				</div>
			</div>
			<!--{/if}-->
		<!--{else}-->
			还没有消息
		<!--{/if}-->
		<!--{if $touid && $pms[list]}-->
		<div class="grid_16">
		<ul class="pm_list" id="pm_ul_post">
			<li class="s_clear">
				<div class="left">
					<div class="avatar">
						<a href="{SITEURL}home/index/{$userinfo[uid]}"><img src="{$userinfo[avatar_small]}"></a>
					</div>
					<div class="pm_body">
						<!--消息头部-->
						<div class="pm_top_a"><div class="pm_top_b"><div class="pm_top_c">&nbsp;</div></div></div>
						<div class="pm_h"><div class="pm_f">
						<p><a href="{SITEURL}home/index/{$userinfo[uid]}">{$userinfo[name]}</a></p>		
						<div class="pm_c">
							<form id="pmform" name="pmform" method="post" action="{SITEURL}/pm/write/?touid=$touid&pmid=$pmid">
							<textarea id="pm_message" name="message" cols="40" rows="4" style="width: 95%;"></textarea><br>
							<p style="padding-top:5px;">
								<input type="submit" name="pmsubmit" id="pmsubmit" value="回复" class="submit" />
								<span id="pmerrormsg"></span>
							</p>
							<input type="hidden" name="touid" value="$touid" />
							<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
							</form>
						</div>
						</div></div>
						<!--消息尾部-->
						<div class="pm_bot_a"><div class="pm_bot_b"><div class="pm_bot_c">&nbsp;</div></div></div>
					</div>
				</div>
			</li>
		</ul>
		</div>
		<!--{/if}-->
	</div>
</div>
<div class="grid_7 omega sidebar">
	<!--{template userinfo_tpl}-->
</div>
<script src="<!--{eval echo base_url();}-->resources/js/jquery.validate.min.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/validate.messages_cn.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/validate.additional-methods.min.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	var validator = $("#pmform").validate({
		onfocusout:false,
		onkeyup:false,
		errorElement:"span",
		rules: {
			message: {
				required: true,
				minlength: 1,
				maxlength:7000
			}
		},
		messages: {
			message: {
				required: "给朋友写点什么吧.",
				minlength: "给朋友写点什么吧",
				maxlength: "您填写的内容太多了。超过了7000个汉字。"
			}
		},
		errorPlacement: function(error, element) {
			error.appendTo($('#pmerrormsg'));
		},
		highlight: function(element, errorClass) {
				$(element).fadeOut(function() {
				$(element).fadeIn();
			});
		},
		success: function(label) {
		}
	});
});
</script>
<!--{template footer_tpl}-->